import com.mclee.util.DateUtil;
import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;
import org.apache.log4j.lf5.DefaultLF5Configurator;

public class Main {
	
	static Logger log = Logger.getLogger(Main.class);
	
	public static void main(String[] args) {
		
		try {
//			DefaultLF5Configurator.configure();
			setLog4jConfig();
		} catch (Exception e) {}
		
		DateUtil du = new DateUtil();
		
//		System.out.println(du.getCurrentDateTime("yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
//		System.out.println(du.getCurrentDateTime("yyyy-MM-dd"));
//		System.out.println(du.getCurrentDateTime("HH:mm:ss.SSS"));
		
		log.debug(du.addDate("20110323", "d", 10));
		System.out.println(du.addDate("20110323", "d", 10));
//		System.out.println(du.addDate("20110323", "d", -10));
//		System.out.println(du.addDate("20110323", "m", 10));
//		System.out.println(du.addDate("20110323", "m", -10));
//		System.out.println(du.addDate("20110323", "y", 10));
//		System.out.println(du.addDate("20110323", "y", -10));
		
		
		System.out.println(du.getDiffDays("20110327", "20110428"));
		
		System.out.println(du.getDay("20110323"));
		System.out.println(du.getDay("20110324"));
	}
	
	
	
	private static void setLog4jConfig() {
		String resource = "log4j.xml";
	    java.net.URL configFileResource = Main.class.getResource(resource);
	    DOMConfigurator.configure(configFileResource.getFile());
	}
}
